附录 B

Elo 软件开发包

介绍

Elo SDK 为编程人员提供了一套 API,用来与 Elo 串行驱动程序和 USB 驱动程序通信。供编程使用的功能如下:

     从触控屏获得未经处理和校準的触控坐标数据

从控制器那里获取触摸数据。可以原始 Elo 坐标格式或转换后的 Windows 坐标格式检索这些数据。要获取数据,可以使用 EloGetTouch。根期望返回的数据类型的标志值,此调用可能会阻塞。要取消阻塞的调用,请使用 EloCancel

         EloGetTouch

         EloCancel

    更改触摸屏的工作模式

触摸屏有以下几种工作模式

触摸屏幕时触发单击触摸屏幕时触发单击会在触摸到触摸屏的瞬间发出鼠标按下/松开消息。用户的手指必须先离开触摸屏,系统才能识别任意位置上发生的新的触摸事件。处于此模式时,不能在屏幕上拖动光标或选定的对象。

离开屏幕时触发单击:离开屏幕时,系统会在接触屏幕的最后一瞬间发出鼠标按下/松开消息。在屏幕的多个对象上拖动时,既不会突出显示,也不会选中这些对象,除非在触及对象时发生离开事件。(拖动与双击)

鼠标仿真:在接触时发出鼠标按下消息。在初次接触对象时选中对象。在屏幕上拖动选定的对象。离开时发出鼠标松开消息。接连两次触摸屏幕上的同一位置,即双击对象。

它们与 Elo 控制面板中的触摸模式相同。您可以使用下面列出的调用获取或更改工作模式:

EloGetMouseMode

EloSetMouseMode

配置拖动延迟   

拖动延迟是为了实现触摸屏的拖动功能。使用此功能之前,必须先校准触摸屏。可使用以下函数检索或修改该值:

EloGetDragDelay

EloSetDragDelay

    启用/禁用触控功能

可以激活触摸屏,允许它向 Windows 系统报告触摸数据,也可以禁用触摸屏,不报告任何触摸数据。

EloGetTouchState

EloSetTouchState

 

                        

     配置摸时的声音

每完成一次摸操作,系统都会发生嘟嘟声作为提示。使用此功能之前,必须先校准触摸屏。用户可以对频率、时间和嘟嘟声进行配置。

EloGetBeep

EloSetBeep

  使用校准 API 保存触摸屏的校正数据

Elo 为视频校正提供了一个标准的校准实用程序。CALIBRATION 用来将 Elo 坐标系下的触摸数据转换成 Windows 虚拟坐标系下的数据。

驱动程序使用下面的方程,可以将 Elo 坐标系中的原始触摸坐标点转换成 Windows 屏幕坐标系中的点。

Calibration equation is

Xcal = a + m*Xuncal,

where,

Xuncal, is in Elo coordinate system

Xcal, is in Windows coordinate system

m = nScrDx / nEloDx

"a", is the X offset value entry

nScrDx = distance between targets in Windows virtual coordinates

nEloDx = distance between targets in Elo coordinates.

如果希望通过网络或在其它一些位置上保存校准数据,稍后再使用一组常用的数据配置触摸屏,该功能非常实用。

要获取驱动程序当前的校准数据,请使用 EloGetCalibrationData;要更改校准数据,请使用

EloGetCalibrationData

EloSetCalibrationData

  定义触摸屏边界

触摸屏边界在 Windows 虚拟桌面上定义了触摸屏的边界矩形。利用触摸屏边界,可以允许/禁止某显示器上的触摸消息传送到相应的显示器中。使用此功能之前,必须先校准触摸屏。

EloGetTouchBoundary

EloSetTouchBoundary

  交换触摸屏鼠标键

利用此函数调用,在随后的几次触摸屏幕操作中,会交换鼠标键。

根据指定的触摸次数,为触摸显示器交换若干次鼠标键。指定的次数用尽后,SDK 会向应用程序窗口发送 WM_SWAPBUTTON 消息,以通知应用程序。使用此功能之前,必须先校准触摸屏。

EloSwapButton

  为左手使用鼠标的用户配置触摸屏

对于左手使用鼠标的用户,请使用以下函数设置触摸屏的模式

EloSetLeftHandedMouse

  检索触摸屏的诊断数据

使用以下函数,可以检索触摸屏的诊断信息

“Elo 控制面板”>“属性选项卡中也会显示这些信息。

EloGetDiagnosticData

  启用快速触摸功能、配置游戏专用模式的触摸屏

 

快速触摸是触摸屏的增强模式,一般用于游戏用途。

在标准操作中,鼠标仿真模式下的一系列连续屏幕触摸操作会生成系统拖动框。

启用该功能后,一系列连续触摸操作将被视为独立的触摸操作,从而形成独立的鼠标单击事件。

使用此功能之前,必须先校准触摸屏。

EloGetQuickTouch

EloSetQuickTouch

  配置边缘加速功能

触摸屏边缘方向进行的触摸操作有时比较难以实现。利用该功能,光标向屏幕边缘方向移动时会获得加速。

使用此功能之前,必须先校准触摸屏。

EloGetAcceleration

EloSetAcceleration

使用开超时功能,定义在同一位置上持续触摸的情况下,
触摸屏自动超时

 

如果在同一位置上持续触摸屏幕,系统会根据该超时时间自动生成离开事件。

对于屏幕上落有灰尘的情况,使用此功能很方便。

使用此功能之前,必须先校准触摸屏。

EloGetUntouchTimeout

EloSetUntouchTimeout

  配置按住时触发右键单击功能

利用此功能,触摸屏可以生成右键单击事件。用户保持触摸屏幕的状态时,会生成右键单击事件。使用此功能之前,必须先校准触摸屏。配置此功能应使用:

EloGetRightClickOnHold

EloSetRightClickOnHold

 

EloPubIf.lib 提供了用来与 Elo 串行驱动程序和 USB 驱动程序通信的 SDK。要想两种驱动程序中的一种通信,请将此库添加到应用程序的编译时期依赖关系列表中,然后在程序中使用相应的接口函数调用。在您的应用程序中包含头文件 EloInterface.h EloErrorCodes.h

Program Files\EloTouchsystems 文件夹下可以找到这些文件。

有关接口的用法,请参阅附录 C”中的启用/禁用示例代码

Elo 设备接口函数

Function Name: EloGetScreenInfo

int EloGetScreenInfo(DWORD dwMonNum[32], int iScrCnt)

参量:
dwMonNum [in]: Array of DWORD to receive the Windows monitor number associated with the touchscreens.

iScrCnt [out]: It retrieves the total number of Elo touchscreens found.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:

它返回与触摸屏有关的 Windows 显示器编号列表,其中索引是触摸屏编号,值是 Windows 显示器编号。

触摸屏编号从 0 开始,Windows 显示器编号从 1 开始。

如果触摸屏尚未校准,Windows 显示器编号返回 -1

最多支持 32 个触摸屏。

要求
包含在 4.20 和更高的版本中。
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

示例和

Function Name: EloGetTouch

int EloGetTouch (PTOUCH_POINT xy, BOOL xlated, GETPOINTS_CODE getCode, UINT nScrNo)

参数:
xy [out]: Pointer to TOUCH_POINT structure to receive the touch coordinates from the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for TOUCH_POINT.

xlated [in]: If TRUE, the coordinates are returned translated for Windows coordinate system. If FALSE, raw coordinate data are returned.

getCode [in]: This can be one of the following values: ReturnImmediately, ReturnOnTouch, ReturnOnUntouch, ReturnOnNextValidTouch. Please see definition for GETPOINTS_CODE.

nScrNo [in/out]: This must be initialized to the zero based touchscreen number. Returns the zero based touchscreen number for the touchscreen touched.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
除非使用值 ReturnImmediately GetCode,否则,在用户触摸指定的屏幕之前,此调用不会返回结果。

要取消阻塞等待,请使用 EloCancel 函数。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloCancel, EloGetScreenInfo, Sample and Error Codes

Function Name: EloCancel

int EloCancel()

参数
无。.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注
取消与驱动程序有关的一切挂起请求。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetTouch,EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetMouseMode

int EloGetMouseMode (WORD *wMode,UINT nScrNo)

参数:
wMode [out]: Returns the touchscreen mode. Please see Constant definition section for TOUCHSCREEN_MODE.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
检索指定触摸屏的触摸模式。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetMouseMode, EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetMouseMode

int EloSetMouseMode (WORD wMode,UINT nScrNo)

参数:
wMode [in]: Touchscreen mode. Please see Constant definition section for TOUCHSCREEN_MODE.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
将指定触摸屏的触摸模式设置为 wMode

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetMouseMode, EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetTouchReportingState

int EloGetTouchReportingState (BOOL *bFlag , UINT nScrNo)

参数:
bFlag [out]: Touch state enabled / disabled. If TRUE, touch data is reported. If FALSE, touch data is not reported.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
获取指定触摸屏的触摸状态。返回值保存在 bFlag 中。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetTouchReportingState, EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetTouchReportingState

int EloSetTouchReportingState (BOOL bFlag, int nScrNo)

参数:
bFlag [in]: Touch state enabled / disabled. If TRUE, touch data is reported. If FALSE, touch data is not reported.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
根据 bFlag 启用或禁用触控功能。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetTouchReportingState, EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetDragDelay

int EloGetDragDelay (PDRAG_DELAY pDragDelay,UINT nScrNo)

参数:
pDragDelay [out]: Pointer to DRAG_DELAY to receive Drag Delay . Please see structure definition section for PDRAG_DELAY.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
获取指定触摸屏的拖动延迟参数。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetDragDelay ,EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetDragDelay

int EloSetDragDelay (PDRAG_DELAY pDragDelay, UINT nScrNo)

参数:
pDragDelay [in]: Dragdelay data. Please see structure definition section for DRAG_DELAY.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
设置指定触摸屏的拖动延迟。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetDragDelay ,EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetBeep

int EloGetBeep (PBEEP pBeepVal, UINT nScrNo)

参数:
pBeepVal [out]: Pointer to BEEP structure to receive data. Please see structure definition section for BEEP.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
获取指定触摸屏的嘟嘟声数据。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetBeep, EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetBeep

int EloSetBeep (PBEEP pBeepVal, UINT nScrNo)

参数:
pBeepVal [in]: Pointer to sound structure to receive data. Please see structure definition section for BEEP definition.

nScrNo [in]: 0 based touchscreen number.

返回值:调用成功则返回 EloSuccess,否则返回错误代码。有关错误值列表,请参阅错误代码部分。

备注:
Sets the touchscreen beep data for the specified touchscreen.

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetBeep, EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetTouchBoundary

int EloGetTouchBoundary(PTOUCH_BOUNDARY ptBndry , UINT nScrNo)

参数:
ptBndry [out]: Pointer to TOUCH_BOUNDARY structure containing full screen boundary data in pixels. Please see structure definition section for TOUCH_BOUNDARY.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
获取指定触摸屏的全屏边界矩形和边界模式。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetTouchBoundary, EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetTouchBoundary

int EloSetTouchBoundary(PTOUCH_BOUNDARY ptBndry, UINT nScrNo)

参数:
ptBndry [in]: Pointer to TOUCH_BOUNDARY structure containing full screen boundary data in pixels. Please see structure definition section for TOUCH_BOUNDARY.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
设置指定触摸屏的全屏边界矩形和边界模式。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetTouchBoundary, EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetCalibrationData

int EloGetCalibrationData (PCALIBRATION pCalData, UINT nScrNo)

参数:
pCalData [out]: Pointer to CALIBRATION structure to receive the calibration data. Please see structure definition section for CALIBRATION.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
检索指定触摸屏的校准模式。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetCalibrationData, EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetCalibrationData

int EloSetCalibrationData (CALIBRATION *pCalData,UINT nScrNo)

参数:
pCalData [in]: Pointer to CALIBRATION structure which stores the calibration data for the touchscreen. Please see structure definition section for CALIBRATION.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
设置指定触摸屏的校准数据。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetCalibrationData, EloGetScreenInfo, Sample and Error Codes

Function Name: EloSwapButton

int EloSwapButton (HWND hWnd, DWORD dwCnt, UINT nScrNo)

参数:
hWnd [in]: Handle to window to receive the WM_ELOSWAPBUTTON message. if NULL, there is no message.

dwCnt [in]: Touch count for which the button should be swapped.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
Swaps the button for the touch monitor for the touch count specified in dwCnt. Once the count is exhausted the DLL notifies the application, by sending a WM_ELOSWAPBUTTON message to the application window specified in hWnd.

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetLeftHandedMouse

int EloSetLeftHandedMouse (BOOL bFlag)

参数:
bFlag [in]: If TRUE it sets touchscreen mode to left-handed mouse.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
Sets the touchscreen mode to left-handed mouse. This does not affect the Windows left-handed mouse settings.

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib.

See Also: EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetDiagnosticsData

int EloGetDiagnosticsData(PSCREEN_PROPERTIES pData, UINT nScrNo)

参数:
pData [in]: Pointer to SCREEN_PROPERTIES structure to receive the diagnostics for the touchscreen. Please see structure definition section for SCREEN_PROPERTIES.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSucces if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
获取指定触摸屏的诊断信息。“Elo 控制面板”>“属性选项卡中也会显示这些信息。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetQuickTouch

int EloGetQuickTouch (PQUICK_TOUCH pQTouch, UINT nScrNo)

参数:
pQTouch [out]: Pointer to QUICK_TOUCH structure to receive the quick touch configuration data from the selected touchscreen. Please see structure definition section for QUICK_TOUCH.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSucces if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
获取指定触摸屏的快速触摸配置参数。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloSetQuickTouch,EloGetScreenInfo, Sample and Error Codes

Function Name: EloSetQuickTouch

int EloSetQuickTouch (PQUICK_TOUCH pQTouch, UINT nScrNo)

参数:
pQTouch [in]: Pointer to QUICK_TOUCH structure containing the quick touch configuration data for the touchscreen. Please see structure definition section for QUICK_TOUCH.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
设置所有触摸屏的快速触摸配置参数。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetQuickTouch EloGetScreenInfo, Sample and Error Codes

Function Name: EloGetEdgeAccel

int EloGetEdgeAccel(PEDGE_ACCEL pAccel, UINT nScrNo)

参数:
pAccel [out]: Pointer to EDGE_ACCEL structure to receive the edge accleration data for the touchscreen. Please see structure definition section for EDGE_ACCEL.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
获取给定触摸屏的边缘加速边界和加速值。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also EloGetScreenInfo, EloSetEdgeAccel, Sample and Error Codes

Function Name: EloSetEdgeAccel

int EloSetEdgeAccel(PEDGE_ACCEL pAccel, UINT nScrNo)

参数:
pAccel [in]: Pointer to EDGE_ACCEL structure to containing the edge accleration data for the touchscreen. Please see structure definition section for EDGE_ACCEL.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
设置给定触摸屏的边缘加速边界和加速值。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, EloGetEdgeAccel, Sample and Error Codes

Function Name: EloGetUntouchTimeout

int EloGetUntouchTimeout(PUNTOUCH_TIMEOUT pUTimeout, UINT nScrNo)

参数:
pUTimeout [out]: Pointer to UNTOUCH_TIMEOUT structure to receive the untouch timeout data for the touchscreen. Please see structure definition section for UNTOUCH_TIMEOUT.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
获取给定触摸屏的离开超时数据。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, EloSetUntouchTimeout, Sample and Error Codes

Function Name: EloSetUntouchTimeout

int EloSetUntouchTimeout(PUNTOUCH_TIMEOUT pUTimeout, UINT nScrNo)

参数:
pUTimeout [in]: Pointer to UNTOUCH_TIMEOUT structure to containing the untouch timeout data for the touchscreen. Please see structure definition section for UNTOUCH_TIMEOUT.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
设置给定触摸屏的离开超时时间。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, EloGetUntouchTimeout, Sample and Error Codes

Function Name: EloGetRightClickOnHold

int EloGetRightClickOnHold(PRIGHT_BUTTON pRBHold, UINT nScrNo)

参数:
pRBHold [out]: Pointer to RIGHT_BUTTON structure to receive the right button on hold data for the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for RIGHT_BUTTON.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
获取给定触摸屏的按住时触发右键单击数据。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, EloSetRightClickOnHold, Sample and Error Codes

Function Name: EloSetRightClickOnHold

int EloSetRightClickOnHold(PRIGHT_BUTTON pRBHold, UINT nScrNo)

参数:
pRBHold [in]: Pointer to RIGHT_BUTTON structure to containing the right button on hold data for the touchscreen. Please see structure definition section for RIGHT_BUTTON.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

备注:
设置给定触摸屏的按住时触发右键单击功能。

要求
包含在 4.20 和更高的版本中。
头文件:在 EloInterface.h 中声明;包含 EloInterface.h
库:使用 EloPubIf.lib

See Also: EloGetScreenInfo, EloGetRightClickOnHold, Sample and Error Codes

Interface Data Structures

Structure Name: SCREEN_PROPERTIES

The SCREEN_PROPERTIES structure contains the diagnostics data for the touchscreen.
typedef struct _SCREEN_PROPERTIES
{

int iWindowsMonNo ;
ULONG Type;
char Port[256];
char SerialNumber[18];
DWORD HardwareHandshaking ;
CONTRL_STAT ctrl_status;
LONG BaudRate;
char crevminor;
char crevmajor;
char trevminor;
char trevmajor;
char diagcodes[8];
char id[8];
char cnt_id[8];
char driver_id[32];

}SCREEN_PROPERTIES, *LPSCREEN_PROPERTIES ;

Members

iWindowsMonNo: Windows monitor number associated with the touchscreen.

Type: Defines the type of touchscreen. Expected values are

USB: 0x01
PNP_SERIAL: 0x02
NT_SERIAL: 0x04
LEGACY_SERIAL: 0x08
RESERVED: 0xFF

Port:The serial port on which this serial touchscreen device is connected. This is blank for USB.

SerialNumber: Serial number for connected touchscreen. Serial numbers uniquely identify a touchscreen.

HardwareHandshaking: This is used only for serial touchscreens. If it is set to 1 hardware handshaking is turned on else if it is set to 0 it is turned off.

ctrl_status: Controller status returned at the time of diagnostics. Please see constants definition for CONTRL_STAT.

BaudRate: This specifies the baud rate for the serial port, valid only for serial touchscreens.

crevminor: Minor revision of controller.

crevmajor: Major revision of controller.

trevminor: Unused.

trevmajor: Unused.

diagcodes: The response received for the diagnostics smartest command sent to the controller.

id: Elo OEM identification returned from the controller.

cnt_id: Contains the response to controller id smartest command to the controller.

driver_id: Driver identification / version string.

Structure Name: TOUCH_POINT

The TOUCH_POINT structure defines a touch coordinate.
typedef struct TOUCH_POINT
{

LONG x;

LONG y;

LONG z;

GETPOINTS_STATUS Status ;

}TOUCH_POINT, *PTOUCH_POINT ;

成员
x: x co-ordinate for touch.

y: y co-ordinate for touch.

z: z co-ordinate for touch.

Status: Receives the touch status. Please see constants definition for GETPOINTS_STATUS.

Structure Name: CALIBRATION

CALIBRATION 结构定义的校准数据用来将 Elo 坐标系下的触摸数据转换成 Windows 虚拟坐标系下的触摸数据。

驱动程序使用下面的方程,可以将 Elo 坐标系中的原始触摸坐标点转换成 Windows 屏幕坐标系中的点。
Calibration equation is

Xcal = a + m*Xuncal,

where,
Xuncal, is in Elo coordinate system
Xcal, is in Windows coordinate system
m = nScrDx / nEloDx
"a", is the X offset value entry
nScrDx = distance between targets in Windows virtual coordinates
nEloDx = distance between targets in Elo coordinates.

typedef struct _Calibration
{

LONG VDeskMode ;
LONG nScrDx ;
LONG nEloDx ;
LONG nOffsetX ;
LONG nScrDy ;
LONG nEloDy ;
LONG nOffsetY ;
LONG xyswap;
LONG MonitorNumber ;
RegistryOperation CalMode ;
LONG xRes ;
LONG yRes ;
LONG xVirtScrSize ;
LONG yVirtScrSize ;
LONG xVirtScrCoord ;
LONG yVirtScrCoord ;
LONG xMonLocn ;
LONG yMonLocn ;

} CALIBRATION, *PCALIBRATION

成员
VDeskMode: Reserved.

nScrDx:
nEloDx:
nOffsetX:
nScrDy:
nEloDy:
nOffsetY:
Data required by calibration. Use the equation above to calculate these values.

xyswap: Specifies if the touchscreen is rotated 90 degrees or 270 degrees. Set to 1 if touchscreen is rotated 90 degrees or 270 degrees else set to 0.

MonitorNumber: Windows monitor numbers are 1 based.

CalMode: Set to TempWrite if the value does not have to be saved over system reboot. For values to be saved over system reboot set this value to Write. Please see constants definition for RegistryOperation.

xRes: Screen width in pixels.

yRes: Screen height in pixels.

xMonLocn: Monitor location (X) for this monitor on the virtual desktop in pixels.

yMonLocn: Monitor location (Y) for this monitor on the virtual desktop in pixels.

xVirtScrSize: Width in pixels of the windows virtual screen.

yVirtScrSize: Height in pixels of the windows virtual screen.

xVirtScrCoord: Top left X coordinate of the Windows virtual screen.

yVirtScrCoord: Top left Y coordinate of the Windows virtual screen.

Structure Name: DRAG_DELAY

The DRAG_DELAY structure is used to get or set drag delay.

typedef struct _Drag_Delay{

DWORD MinDragDelay ;

DWORD MaxDragDelay ;

DWORD DragDelay ;

} DRAG_DELAY, *PDRAG_DELAY ;

成员
MinDragDelay:
MaxDragDelay:
Reserved.

DragDelay: Drag delay value in milliseconds.

Structure Name: BEEP

The BEEP structure is used to get or set beep parameter data.

typedef struct _Beep{

BOOL BeepFlag;

DWORD BeepFreq ;

DWORD BeepTime ;

} SOUND, *PBEEP ;

成员
BeepFlag: If TRUE touchscreen beeps on touch.

BeepFreq: Frequency of beep in Hz.

BeepTime: Duration of beep in milliseconds.

Structure Name: TOUCH_BOUNDARY

The TOUCH_BOUNDARY structure defines the full screen bounding rectangle and bounding mode for the touchscreen.

typedef struct _Touch_Boundry

{

ClippingBounds Bounds;

LONG ClippingMode;

} TOUCH_BOUNDARY, *PTOUCH_BOUNDARY ;

成员
边界:定义屏幕的触摸边界矩形。请参阅 ClippingBounds 结构。有关这些边界的说明,请参阅下面的 ClippingMode

ClippingMode:定义虚拟桌面上触摸屏边界的模式。可能的值如下:
0:禁用虚拟桌面。所有屏幕上的触摸信息将反映在主显示器上。
1
:启用虚拟桌面。在此模式下,不对显示器应用具体的屏幕边界。向边缘方向进行的触摸操作可能会在相邻显示器上产生单击事件。
2
:启用虚拟桌面。激活每个显示器的屏幕边界。屏幕上的触摸操作始终会在相关联的显示器上产生单击事件。触摸边界矩形以外的点时,光标会移动到距离触摸点最近的边界点上。
3
:启用虚拟桌面。激活每个显示器的屏幕边界。屏幕上的触摸操作始终会在相关联的显示器上产生单击事件。触摸边界矩形以外的位置时,不会向系统发送触摸信息。

Structure Name: QUICK_TOUCH

The QUICK_TOUCH data structure defines the Quick touch configuration parameters.

typedef struct _Quick_Touch

{

DWORD bEnable ;

ULONG Dx ;

ULONG Dy ;

} QUICK_TOUCH, *PQUICK_TOUCH;

成员
bEnable: 0 disables quick touch , 1 enables it.

Dx: X distance in pixels. Touches outside this distance will generate quick touches.

Dy: Y distance in pixels. Touches outside this distance will generate quick touches.

Structure Name: ClippingBounds

The ClippingBounds structure is used to define the bounding rectangle.

typedef struct _ClippingBounds{

ULONG X_Max;

ULONG X_Min;

ULONG Y_Max;

ULONG Y_Min;;

ULONG Z_Max ;

ULONG Z_Min ;

} ClippingBounds, *PClippingBounds ;

成员
X_Min:

Specifies the X coordinate of the upper-left corner of the rectangle in pixels.

Y_Min:
Specifies the Y coordinate of the upper-left corner of the rectangle in pixels.

X_Max:
Specifies the X coordinate of the lower-right corner of the rectangle in pixels.

Y_Max:
Specifies the Y coordinate of the lower-right corner of the rectangle in pixels.

Z_Max:
Z_Min:
Reserved.

Structure Name: EDGE_ACCEL

The EDGE_ACCEL structure is used to define the bounding rectangle.

typedef struct _ Accel{

ULONG Enable ;

ULONG Scale ;

ClippingBounds Bounds[1] ;

} EDGE_ACCEL, *PEDGE_ACCEL ;

成员
Enable: 0 disables acceleration, 1 enables it.

Scale: Acceleration scale be anywhere in the range of 0-100. 10 indicates no acceleration.

Bounds: Defines the edge of the touchscreen acceleration bounds. See structure ClippingBounds.

Structure Name: RIGHT_BUTTON

The RIGH_BUTTON structure is used to define the right click on hold feature.

typedef struct _ Right_Button{

DWORD RightClickHW ;

style='color:black;text-decoration: none;text-underline:none'>DWORD InitialTimeout ;

style='color:windowtext; text-decoration:none;text-underline:none'>DWORD DefaultRightClickDelay ;

DWORD         MaxRightClickDelay ;

<DWORD       MinRightClickDelay ;

ULONG           ClickCount;

ULONG           Active ;

} RIGHT_BUTTON, *PRIGHT_BUTTON;

成员
RightClickHW: Height and width in pixels defining the area in which right click is valid.

InitialTimeout: The initial timeout after which the cursor changes to the right click cursor.

DefaultRightClickDelay: Right click delay value in milliseconds.

MinRightClickDelay:
MaxRightClickDelay:
Reserved.

ClickCount: Touch count for which the right click on hold feature should be active. A value of 0xffffffff keeps it active for ever. A value of 0 turns it off.

Active: Value of 1 keeps right click on hold active on reboot. Value of 0 turns it off on reboot. This works in combination with ClickCount. To keep it turned on after reboot value for Active should be set to 1 and value for ClickCount should be set to 0xffffffff.

Structure Name: UNTOUCH_TIMEOUT

The UNTOUCH_TIMEOUT structure is used to define the untouch timeout.

typedef struct _UNTOUCH_TIMEOUT{

ULONG Timeout ;

ULONG Width ;

ULONG Height ;

} UNTOUCH_TIMEOUT, *PUNTOUCH_TIMEOUT ;

成员
Timeout:
Untouch timeout value in milliseconds.

Width: Specifies the width in pixels for the screen area within which a constant touch will automatically result in untouch after the Timeout occurs.

Height: Specifies the height in pixels for the screen area within which a constant touch will automatically result in untouch after the Timeout occurs.

Constants: GETPOINTS_CODE

The blocked call returns data depending on this value.

typedef enum _GETPOINTS_CODE

{

ReturnImmediately=1,

ReturnOnTouch,

ReturnOnUntouch,

ReturnOnNextValidTouch

}GETPOINTS_CODE ;

Values
ReturnImmediately: Returns immediately with the last touch data values. Does not wait for a user to touch the screen.

ReturnOnTouch: Waits for user to touch and then returns data.

ReturnOnUntouch: Waits for user to release touch and then returns data.

ReturnOnNextValidTouch: Waits for the user to touch the screen and returns on the next initial touch, stream touch or untouch event.

Constants: CONTRL_STAT

Controller status is returned as

typedef enum _CONTRL_STAT

{

CS_OK = 0,

CS_ConstantTouch,

CS_CanNotFindController,

CS_NoResponse,

CS_InvalidResponse,

CS_CanNotSetBaudRate,

CS_CommandNotSent,

CS_SystemError,

CS_InvalidCommPort,

CS_CommPortFailedOpen,

CS_CommPortCommandError,

CS_CommPortNoController,

CS_UndefinedController

} CONTRL_STAT;

Values
CS_OK: Everything works fine.

CS_ConstantTouch: There is constant touch detected on the touchscreen.

CS_CanNotFindController: No controller found.

CS_NoResponse: No response from controller.

CS_InvalidResponse: Incorrect response, maybe due to out of sync.

CS_CanNotSetBaudRate: Baud rate cannot be set.

CS_CommandNotSent: Smartset command could not be sent to the controller.

CS_SystemError: System Error.

CS_InvalidCommPort: No touchscreen connected on the serial port specified.

CS_CommPortFailedOpen: Error opening serial port.

CS_CommPortCommandError: Communications error.

CS_CommPortNoController: No controller.

CS_UndefinedController: Unidentified controller.

Constants: RegistryOperation

Driver writes the values to the registry if Write flag is set else it initializes the local buffer and does not save it to the registry.

typedef enum

{

TempWrite=1,

Write

}RegistryOperation;

Values
TempWrite: Writes data to local buffer. Does not write it to the registry.

Write: Writes data to local buffer and registry.

Constants: TOUCHSCREEN_MODE

Valid TOUCHSCREEN_MODE for the touchscreen.

#define CLICK_ON_TOUCH

0

#define CLICK_ON_RELEASE

1

#define MOUSE_EMULATION

6

CLICK_ON_TOUCH触摸屏幕时触发单击会在接触到触摸屏的瞬间发出鼠标按下/松开消息。用户的手指必须先离开触摸屏,系统才能识别任意位置上发生的新的触摸事件。处于此模式时,不能在屏幕上拖动光标或选定的对象。

CLICK_ON_RELEASE:启用离开屏幕时触发单击后,离开屏幕时,系统会在接触屏幕的最后一瞬间发出鼠标按下/松开消息。在屏幕的多个对象上拖动时,既不会突出显示,也不会选中这些对象,除非在触及对象时发生离开事件。(拖动与双击)

MOUSE_EMULATION:在接触时发出鼠标按下消息。在初次接触对象时选中对象。在屏幕上拖动选定的对象。离开时发出鼠标松开消息。接连两次触摸屏幕上的同一位置,即双击对象。

Constants: GETPOINTS_STATUS

Valid mode for the touchscreen.

typedef enum _GETPOINTS_STATUS

 

InitialTouch =

1,

StreamTouch=

2,

UnTouch =

4

GETPOINTS_STATUS;

 

InitialTouch: The touch data was returned on initial touch.

StreamTouch: The touch data was returned on stream touch.

UnTouch: The touch data was returned on untouch.

Error Codes: Returned from the Interface DLL

#define EloSuccess

0

#define EloFailure

1

#define EloErrorInIoctl

2

#define EloErrorCallWasCancelled

3

#define EloErrorInvalidTouchScreen

4

#define EloErrorInvalidMonitorNo

5

#define EloErrorInvalidBuffer

6

#define EloErrorInvalidHandle

7

#define EloErrorNoDriver

8

#define EloErrorInvalidCommand

10

#define EloErrorVersionLock

11

#define EloErrorBufferSize

12

#define EloErrorTouchDeviceNotWorking

13

#define EloErrorTouchScreenNumberInvalid

14

#define EloErrorNoMoreTouchScreens

15

#define EloErrorInvalidScreenNumber

16

#define EloErrorUnknown

17

#define EloErrorNotImplemented

18

#define EloErrorDeviceBusy

19

#define EloErrorIncompatibleVersion

20

 

返回